<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
	<head>
		<jsp:include page="../common/dwrEasyui.jsp"></jsp:include>
		<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/roleDao.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/roleQueryService.js'></script>
	<script src="<%=request.getContextPath()%>/script/basic.js" charset="UTF-8" type="text/javascript"></script>
	<script type="text/javascript">
	var columns = [ [ {
		field : "ROLE_ID",
		checkbox : true
	}, {
		field : "ROLE_NAME",
		title : '角色名称',
		width : 80,
		sortable : true
	}, {
		field : "ROLE_DESC",
		title : '角色描述',
		width : 300,
		sortable : true
	}, {
		field : "ORG_ID",
		title : '机构ID',
		width : 100,
		sortable : true
	}, {
		field : "ROLE_TYPE",
		title : '角色类型',
		width : 100,
		sortable : true
	}, {
		field : "ROLE_ENABLED",
		title : '是否可用',
		width : 100,
		sortable : true,
		formatter: sy.dgYNFormatter
	}, {
		field : "ROLE_GRANT",
		title : '是否可以向下授权',
		width : 180,
		sortable : true,
		formatter: sy.dgYNFormatter
	} ] ];

	$(function(){
		var crud = new CRUD({queryService : roleQueryService , dao : roleDao});
		crud.init({idField : "ROLE_ID",columns : columns});
	});
</script>
  </head>
  
  <body id="layout" class="easyui-layout" data-options="fit:true">
  
  	<div data-options="region:'center',split:true" style="padding:5px;background:#eee;">
	    <div id="gridToolbar" style="padding:5px;height:auto;margin-bottom:5px">
	    	<form id="searchForm">
	          	Date From: <input class="easyui-datebox" style="width:80px">
	            To: <input class="easyui-datebox" style="width:80px">
	            Language: 
	            <select class="easyui-combobox" panelHeight="auto" style="width:100px">
	                <option value="java">Java</option>
	                <option value="c">C</option>
	                <option value="basic">Basic</option>
	                <option value="perl">Perl</option>
	                <option value="python">Python</option>
	            </select>
	            <a id="search" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search">Search</a>
		   	</form>
	    	<table style="margin-top: 5px;">
	    		<tr>
		    		<td>
		    			<a id="add_btn" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true">添加</a>
		    		</td>
		    		<td>
		    			<div class="datagrid-btn-separator"></div>
		    		</td>
		    		<td>
		    			<a id="edit_btn" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>
		    		</td>
		            <td>
		    			<div class="datagrid-btn-separator"></div>
		    		</td>
		            <td>
		            	<a id="del_btn" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" plain="true">删除</a>
		            </td>
		            <td>
		    			<div class="datagrid-btn-separator"></div>
		    		</td>
		            <td>
		            	<a id="batch_del_btn" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true">批量删除</a>
		            </td>
	   			</tr>
	   		</table>
	    </div>
	    <table id="datagrid"></table>
     </div>
     
     <div data-options="region:'south',split:true" style="height:200px;overflow: hidden;">
     	<div id="tabs" class="easyui-tabs" data-options="fit:true">
		    <div title="主页面" id="mainTab">
		    	<div id="panel" toolbar="#toolbar" fit="true">
					<div id="toolbar" class="datagrid-toolbar">
					   <a href="javascript:void(0)" class="easyui-linkbutton" id="mainForm_btnSave" iconCls="icon-save" plain="true">保存</a>
					   <div class="datagrid-btn-separator"></div>
					   <a href="javascript:void(0)" class="easyui-linkbutton" id="mainForm_btnCancel" iconCls="icon-cancel" plain="true">取消</a>
					</div>
					<form id="mainForm" method="post">
						<input type="hidden" name="role_id" >
						<table class="tableForm">
							<tr>
								<td>角色名称</td>
								<td><input class="easyui-validatebox" type="text" name="role_name" data-options="required:true"/></td>
								<td>角色描述</td>
								<td><input type="text" name="role_desc"/></td>
							</tr>
							<tr>
								<td>
									机构
								</td>
								<td>
									<input type="text" id="mainForm_org_id" name="org_id">
								</td>
								<td>
									角色类型
								</td>
								<td>
									<select class="easyui-combobox" name="role_type" style="width:200px;">
									    <option value="1">普通角色</option>
									    <option value="2">管理员角色</option>
									</select>
								</td>
							</tr>
							<tr>
								<td>
									是否可用
								</td>
								<td>
									<select class="easyui-combobox" name="role_enabled" style="width:200px;">
										<option value="1">是</option>
										<option value="0">否</option>
									</select>
								</td>
								<td>
									是否可向下级授权
								</td>
								<td>
									<select class="easyui-combobox" name="role_grant" style="width:200px;">
										<option value="1">是</option>
										<option value="0">否</option>
									</select>
								</td>
							</tr>
						</table>
					</form>
				</div>
		    </div>
		    <div title="tab2" style="" id="tab2"></div>
		</div>
     </div>
  </body>
</html>
